/**
 * AlertQueryDaoImpl.java
 * Created at 2017-11-2
 * Created by zhanghailin
 * Copyright (C) 2017 BROADTEXT SOFTWARE, All rights reserved.
 */
package com.broadtext.rms.system.dao.impl;

import java.util.Map;

import org.apache.ibatis.session.SqlSession;
import org.springframework.stereotype.Repository;

import com.broadtext.common.exp.DaoException;
import com.broadtext.common.repository.EntityDao;
import com.broadtext.rms.system.dao.IAlertQueryDao;
import com.broadtext.rms.system.model.TtPackCustomAlert;

/**
 * <p>ClassName: AlertQueryDaoImpl</p>
 * <p>Description: TODO</p>
 * <p>Author: zhanghailin</p>
 * <p>Date: 2017-11-2</p>
 */
@Repository("alertQueryDao")
public class AlertQueryDaoImpl extends EntityDao<TtPackCustomAlert> implements IAlertQueryDao{

    /** (non-Javadoc)
     * <p>Title: getAlertCount</p>
     * <p>Description: </p>
     * @return
     * @see com.broadtext.rms.system.dao.IAlertQueryDao#getAlertCount()
     */
    @Override
    public long getAlertCount(Map<String, Object> params) {
        long count = 0;
        try {
            SqlSession session = this.getCurrentSession();
            count = session.selectOne("com.broadtext.rms.system.model.TtPackCustomAlert.getAlertCount",params);
            session.close();
        } catch (DaoException e) {
            e.printStackTrace();
            return 0;
        }
        return count;
    }
    
    

}
